﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.IO;
using System.Text;

namespace ECommerce.Utilidades
{
    public static class Request
    {
        public static string GetPage(string nombrePagina)
        {
            //Para traer la pagina a cachear
            WebResponse objResponse;
            WebRequest objRequest;
            //para contener su contenido
            StreamReader strReader;

            objRequest = System.Net.HttpWebRequest.Create(nombrePagina.Replace("__", "&"));
            objResponse = objRequest.GetResponse();
            strReader = new StreamReader(objResponse.GetResponseStream(), Encoding.UTF8);
            return strReader.ReadToEnd();
        }
        public static string RequestPage(string url)
        {
            return GetPage(url);
        }
    }
}
